import {
	createRouter,
	createWebHistory, //这是一种hash模式
	// createWebHashHistory, //这是一种history模式
} from "vue-router";

// 没有懒加载
import Home from "../views/Home/index.vue";
import About from "../views/About/index.vue";

export default createRouter({
	// 前端路由的模式
	history: createWebHistory(),
	// 前端路由配置项
	routes: [
		{ path: "/", redirect: "/home", name: "Firstview" },
		{
			path: "/home",
			name: "Home",
			component: Home,
			// component: () => import("../views/Home/index.vue"),
		},
		{
			path: "/about",
			name: "About",
			component: About,
			// component: () => import("../views/About/index.vue"),
		},
	],
});
